<template>
  <div>
    <div class="header">
      <span class="search-header">搜索用户数</span>
      <svg t="1719390039740" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"
        p-id="4559" width="20" height="20">
        <path
          d="M536 480v192a16 16 0 0 1-16 16h-16a16 16 0 0 1-16-16V480a16 16 0 0 1 16-16h16a16 16 0 0 1 16 16z m-32-128h16a16 16 0 0 1 16 16v32a16 16 0 0 1-16 16h-16a16 16 0 0 1-16-16v-32a16 16 0 0 1 16-16z m8 448c159.056 0 288-128.944 288-288s-128.944-288-288-288-288 128.944-288 288 128.944 288 288 288z m0 48c-185.568 0-336-150.432-336-336s150.432-336 336-336 336 150.432 336 336-150.432 336-336 336z"
          fill="#000000" p-id="4560"></path>
      </svg>

    </div>
    <div class="main">
      <span class="main-title">12345</span>
      <span class="main-content">17.1</span>
      <svg t="1719391826868" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"
        p-id="12372" width="16" height="16">
        <path d="M512 0l384 512h-256l-128 512-128-512H128z" fill="#D7000F" p-id="12373"></path>
      </svg>
      <svg t="1719391942699" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"
        p-id="6638" width="16" height="16">
        <path d="M512 1024L128 512h256l128-512 128 512h256z" fill="#45FB80" p-id="6639"></path>
      </svg>

    </div>
    <div class="footer">
      <div class="charts" ref="charts"></div>
    </div>
  </div>
</template>

<script>
import * as echarts from 'echarts';
export default {
  name: 'LineChart',
  mounted() {
    let lineCharts = echarts.init(this.$refs.charts)
    let options = {
      xAxis: {
        show: false,
        type: 'category'
      },
      yAxis: {
        show: false
      },
      series: [
        {
          data: [10, 77, 33, 88, 15, 47, 67, 12, 56, 10, 39],
          type: 'line',
          smooth: true,
          // 拐点的样式的设置
          itemStyle: {
            opacity: 0
          },
          // 线条的样式
          lineStyle: {
            color: "green",
          },
          areaStyle: {
            color: {
              type: 'linear',
              x: 0,
              y: 0,
              x2: 0,
              y2: 1,
              colorStops: [{
                offset: 0, color: 'green' // 0% 处的颜色
              }, {
                offset: 1, color: '#fff' // 100% 处的颜色
              }],
              global: false // 缺省为 false
            }
          },

        },

      ],
      grid: {
        left: 0,
        right: 0,
        top: 0,
        bottom: 0,
      },
    }

    lineCharts.setOption(options)


  },

}
</script>

<style scoped>
.header {
  display: flex;
  align-items: center;
}

.search-header {
  margin-right: 20px;
}

.main {
  margin: 10px 0px;
}

.main-title {
  margin-right: 30px;
}

.main-content {
  margin-right: 10px;
}

.charts {
  width: 100%;
  height: 50px;
}</style>
